home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Leser 15 / Amiga Plus Leser CD 15.iso / Tools / Development / CIT.v4 / citra / CITLists.h < prev    next >
Encoding:
C/C++ Source or Header  |  2002-03-13  |  1.9 KB  |  75 lines

  1. //
  2. //       CITList and CITNode include
  3. //
  4. //                         StormC
  5. //
  6. //            version 2001.12.29
  7. //
  8.  
  9. #ifndef CIT_LISTS_H
  10. #define CIT_LISTS_H TRUE
  11.  
  12. #include <exec/types.h>
  13. #include <exec/nodes.h>
  14. #include <exec/lists.h>
  15. #include <proto/exec.h>
  16.  
  17. //
  18. // CIT node types
  19. //
  20. #define CITAPPCLASSNODE      100
  21. #define CITSCREENCLASSNODE   101
  22. #define CITWINDOWCLASSNODE   102
  23.  
  24. class CITNode:public Node
  25. {
  26.   public:
  27.     CITNode();
  28.     
  29.     void  NodeType(UBYTE t) { ln_Type = t; }
  30.     UBYTE NodeType() { return ln_Type; }
  31.     void  Priority(BYTE p);
  32.     BYTE  Priority() { return ln_Pri; }
  33.     void  NodeName(char* name) { ln_Name = name; }
  34.     char* NodeName() { return ln_Name; }
  35.     
  36.     class CITNode *Succ()
  37.       { return( ln_Succ->ln_Succ ? (class CITNode *)ln_Succ : NULL); }
  38.     class CITNode *Pred()
  39.       { return( ln_Pred->ln_Pred ? (class CITNode *)ln_Pred : NULL); }
  40.     BOOL Inserted() { return( (ln_Succ!=NULL) && (ln_Pred!=NULL) ); }
  41. };
  42.  
  43. //
  44. // Enqueue modes
  45. //
  46. #define ENQUEUE_PRIORITY      0
  47. #define ENQUEUE_NAME          1
  48. #define ENQUEUE_PRIORITYNAME  2
  49. #define ENQUEUE_NAMEPRIORITY  3
  50. #define ENQUEUE_NOCASE        0x8000
  51.  
  52. class CITList:public List
  53. {
  54.   public:
  55.     CITList();
  56.     
  57.     void AddHead(class CITNode *np) { ::AddHead(this,np); }
  58.     void AddTail(class CITNode *np) { ::AddTail(this,np); }
  59.     void Enqueue(class CITNode *np,short mode = ENQUEUE_PRIORITY);
  60.     void Insert(class CITNode *n,class CITNode *ln) {::Insert(this,n,ln);}
  61.     void Remove(class CITNode *np);
  62.     class CITNode *RemHead();
  63.     class CITNode *RemTail();
  64.     class CITNode *Head()
  65.       { return( lh_Head->ln_Succ ? (class CITNode *)lh_Head : NULL ); }
  66.     class CITNode *Tail()
  67.       { return( lh_Head->ln_Succ ? (class CITNode *)lh_TailPred : NULL ); }
  68.     class CITNode *FindName(char *s)
  69.       {return( (class CITNode *)::FindName(this,s) );}
  70.     class CITNode *FindName(class CITNode *np,char *s)
  71.       {return( (class CITNode *)::FindName((class CITList *)np,s) );}
  72. };
  73.  
  74. #endif
  75.